home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / DELPHI / DABTNS.ZIP / DA3DLABT.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-05-29  |  2.8 KB  |  109 lines

  1. { This is my Custom About Box designed specifically for TechnoSoft }
  2. unit Da3dlabt;
  3.  
  4. interface
  5.  
  6. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, StdCtrls,
  7.   Buttons, ExtCtrls, SysUtils, Rzlabel;
  8.  
  9. type
  10.   TDB3DLabAboutBox = class(TForm)
  11.     Panel1: TPanel;
  12.     ProgramIcon: TImage;
  13.     Panel2: TPanel;
  14.     Label8: TLabel;
  15.     Label10: TLabel;
  16.     UserName: TLabel;
  17.     CompanyName: TLabel;
  18.     Panel3: TPanel;
  19.     Label1: TLabel;
  20.     Label2: TLabel;
  21.     Label3: TLabel;
  22.     Label4: TLabel;
  23.     WinVersion: TLabel;
  24.     DosVersion: TLabel;
  25.     Coprocessor: TLabel;
  26.     CPU: TLabel;
  27.     Panel4: TPanel;
  28.     Label5: TLabel;
  29.     Label6: TLabel;
  30.     Label9: TLabel;
  31.     FreeMemory: TLabel;
  32.     FreeResources: TLabel;
  33.     FreeDisk: TLabel;
  34.     Panel5: TPanel;
  35.     Panel6: TPanel;
  36.     BitBtn1: TBitBtn;
  37.     Version: TRzLabel;
  38.     VersionNumber: TRzLabel;
  39.     Copyright: TRzLabel;
  40.     ProductName: TRzLabel;
  41.     Comments: TRzLabel;
  42.     procedure Button1Click(Sender: TObject);
  43.     procedure FormActivate(Sender: TObject);
  44.   private
  45.     fileHandle: THandle;
  46.     fileBuffer: Array [0..29] of Char;
  47.     wVersion: Word;
  48.     dVersion: Word;
  49.     winFlags: LongInt;
  50.   public
  51.     { Public declarations }
  52.   end;
  53.  
  54. implementation
  55.  
  56. {$R *.DFM}
  57.  
  58. procedure TDB3DLabAboutBox.Button1Click(Sender: TObject);
  59. begin
  60.   Close;
  61. end;
  62.  
  63. procedure TDB3DLabAboutBox.FormActivate(Sender: TObject);
  64. begin
  65.   { Get Win/Dos version numbers }
  66.   wVersion := LoWord(GetVersion);
  67.   dVersion := HiWord(GetVersion);
  68.   WinVersion.Caption := IntToStr(LO(wVersion)) + '.' +
  69.                         IntToStr(HI(wVersion));
  70.   DosVersion.Caption := IntToStr(HI(dVersion)) + '.' +
  71.                         IntToStr(LO(dVersion));
  72.  
  73.   winFlags := GetWinFlags;
  74.  
  75.   { Get math coprocessor status }
  76.   if winFlags and WF_80x87 > 0 then
  77.      Coprocessor.Caption := 'Present'
  78.   else
  79.      Coprocessor.Caption := 'Not Present';
  80.  
  81.   { Get CPU type }
  82.   if winFlags and WF_CPU486 > 0 then
  83.      CPU.Caption := '486 or Pentium';
  84.   if winFlags and WF_CPU386 > 0 then
  85.      CPU.Caption := '386';
  86.   if winFlags and WF_CPU286 > 0 then
  87.      CPU.Caption := '286';
  88.  
  89.   { Get free memory, resources, disk space }
  90.   FreeMemory.Caption := IntToStr(GetFreeSpace(0) div 1000) + ' KB';
  91.   FreeResources.Caption := IntToStr(GetFreeSystemResources(GFSR_SYSTEMRESOURCES))
  92.                                + '%';
  93.   FreeDisk.Caption := IntToStr(DiskFree(3) div 1000000) + ' MB';
  94.  
  95.   { Get user name and company name }
  96.   fileHandle := LoadLibrary('USER');
  97.  
  98.   if fileHandle >= HINSTANCE_ERROR then begin
  99.     if LoadString(fileHandle, 514, @fileBuffer, 30) <> 0 then
  100.        UserName.Caption := fileBuffer;
  101.     if LoadString(fileHandle, 515, @fileBuffer, 30) <> 0 then
  102.        CompanyName.Caption := fileBuffer;
  103.     FreeLibrary(fileHandle);
  104.   end;
  105. end;
  106.  
  107. end.
  108.  
  109.